<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>班级管理</title>
    <link rel="stylesheet" href="../../js/bower_components/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-select/dist/css/bootstrap-select.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-table/dist/bootstrap-table.min.css">
    <link rel="stylesheet" href="../../js/bower_components/bootstrap-treeview/dist/bootstrap-treeview.min.css">

    <script src="../../js/bower_components/jquery/dist/jquery.min.js"></script>
    <script src="../../js/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="../../js/bower_components/bootbox.min.js"></script>
    <script src="../../js/bower_components/bootstrap-select/js/bootstrap-select.js"></script>
    <script src="../../js/bower_components/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
    <script src="../../js/bower_components/bootstrap-table/dist/bootstrap-table.min.js"></script>
    <script src="../../js/bower_components/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js"></script>
    <script src="../../js/bower_components/bootstrap-treeview/dist/bootstrap-treeview.min.js"></script>
    <script src="../../js/bower_components/jquery-form-validator/form-validator/jquery.form-validator.min.js"></script>
    <script src="../../js/bower_components/moment/min/moment-with-locales.min.js"></script>
    <SCRIPT>
        $(function () {
            $("table").bootstrapTable({locale:'zh-CN'});
            initDictType();
            createTable();
        });
        function createTable() {
            $("#tblResult").bootstrapTable('destroy');
            $("#tblResult").bootstrapTable({
                url:"Role/getAllUsingPUT",
                //data:'catalog.json',
                method:'post',
                pagination: true,
                sidePagination:'client',//'server',
                singleSelect: false,
                clickToSelect: true,
                contentType:'application/x-www-form-urlencoded; charset=UTF-8',
                queryParams:function(param) {
                    return {
                        'pageSize':param.limit,
                        'pageIndex':(param.offset / param.limit),
                        'press':$('#pressCategory').val(),
                        'author':$('#txtAuthorName').val(),
                        'publishtime':$('#tbxInstockDate').val(),
                        'edition':$('#cbkConsumptive').bootstrapSwitch('state')
                    };
                },
                onClickRow:function(row){
                    //alert(row.bid);
                    gbid=row.bid;
                },
                onCheck:function(row){
                    //alert(row.bid);
                },
                responseHandler:function(res){
                    return {
                        "total": res.total,//总页数
                        "rows": res.rows //数据
                    };
                },
                columns: [
                    {field:'code',title:"<span class='glyphicon glyphicon-tags' /> 班级主键", halign:'center'},
                    {field:'namecn', title:"班级名称", halign:'center'},
                    {field:'parentname', title:"学校", halign:'center'},
                    {field:'comment', title:"备注信息", halign:'center'}
                ]
            });
        }
        function initDictType() {
            $('#selParent').empty();
            option = new Option("全部","-1");
            $('#selParent').append(option);
            $('#selParent').selectpicker("refresh");
            $('#selParent').selectpicker("render");
        }
    </SCRIPT>
</head>
<body>
    <div class="container-fluid">
        <div class="row col-md-10">
            <div id="divSearchForm" class="form-inline">
                <div class="form-group">
                    <label class="control-label" for="tbxNamecn">班级名称：</label>
                    <input class="form-control" type="text" id="tbxNamecn" />
                </div>
                <div class="form-group">
                    <label class="control-label" for="selParent">学校名称：</label>
                    <select id="selParent" ></select>
                </div>
                <div class="form-group">
                    <button type="button" id="btnSearch" class="btn btn-primary">
                        <span class="glyphicon glyphicon-search" />
                        检索Search
                    </button>
                </div>
            </div>
        </div>
        <div class="row col-md-10" style="margin-top: 10px;">
            <table id="tblResult"></table>
        </div>
    </div>
</body>
</html>
